from django.db import models
from user.models import User


class Vote(models.Model):
    user = models.ForeignKey(User, on_delete=True)
    info = models.TextField()
    multiple_selection = models.BooleanField()
    other_people_add_select = models.BooleanField()

    class Meta:
        db_table = 'votes'


class VoteOption(models.Model):
    user = models.ForeignKey(User, on_delete=True)
    vote = models.ForeignKey(Vote, on_delete=True)
    content = models.TextField()

    class Meta:
        db_table = 'vote_options'


class VoteResult(models.Model):
    user = models.ForeignKey(User, on_delete=True)
    vote = models.ForeignKey(Vote, on_delete=True)
    vote_option = models.ForeignKey(VoteOption, on_delete=True)
    comment = models.TextField()

    class Meta:
        db_table = 'vote_results'
